import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;
import org.apache.log4j.Logger;


public class Increment implements JavaDelegate{
	private static Logger logger = Logger.getLogger("Increment");
	@Override
	public void execute(DelegateExecution arg0) throws Exception {
		logger.info(arg0.getProcessInstanceId());
		int IEcount=(Integer)arg0.getVariable("IEcount");
		int IEcomplete=(Integer)arg0.getVariable("IEcomplete");
		IEcomplete++;
		arg0.setVariable("IEcomplete", IEcomplete);
		if(IEcomplete== IEcount)
		{
			arg0.setVariable("result", 1);
		}
	}

}
